{include file="public/header" /}
<body>
<div class="pd-20">
  <form action="" method="post" class="form form-horizontal" id="form-add">

    <div class="row cl">
        <div class="formControls col-10">
            <textarea name="replycontent" cols="" rows="" class="textarea"  placeholder="说点什么..."></textarea>
        </div>
    </div>

    <div class="row cl">
        <div class="col-5 col-offset-0">
            <input type="hidden" value="{$id}" name="id">
            <input type="hidden" value="1" name="status">
            <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
        </div>
    </div>

  </form>
</div>
</div>
{include file="public/footer" /}
<script type="text/javascript">
$(function(){
    $("#form-add").validate({
        rules:{
            username:{
                required:true,
                maxlength:16
            },
        },
        onkeyup:false,
        focusCleanup:true,
        success:"valid",
        submitHandler:function(form){
            $(form).ajaxSubmit({
                success:function(data){
                    console.log(data);
                    if(data.status == 'y'){
                        layer.msg("操作成功",{icon:1,time:1000,shade: [0.3, '#000']},function(){
                            var index = parent.layer.getFrameIndex(window.name);
                            parent.location.reload();
                            parent.layer.close(index);
                        });
                    }else{
                        layer.msg(data.info,{icon:2,time:1000,shade: [0.3, '#000']});
                    }
                },
                error:function(error){
                    layer.msg('系统发生了错误',{icon:2,time:3000,shade: [0.5, '#FF0000']});
                }
            });

        }
    });
});
</script>
</body>
</html>